Repository navigation
Add shadowdom-customelements tests - #5705
Conversation
|
Notifying @hayatoito, @kojiishi, @rniwa, and @TakayoshiKochi. (Learn how reviewing works.) |
| this.shadowRoot.innerHTML = '<slot></slot>'; | ||
| var slot = this.shadowRoot.children[0]; | ||
| slot.addEventListener('slotchange', function() { | ||
| calls.push(this); |
There was a problem hiding this comment.
This might be better as calls.push(this.id). Then below you can do a single test, something like assert_array_equals(calls, ["upgrade", "parser"]). That has the bonus of testing that things are in the correct order.
LintPassed |
Firefox (nightly channel)Testing web-platform-tests at revision f8caaa4 All results1 test ran/shadow-dom/slotchange-customelements.html
|
Chrome (unstable channel)Testing web-platform-tests at revision f8caaa4 All results1 test ran/shadow-dom/slotchange-customelements.html
|
|
These tests are now available on w3c-test.org |
…tor and `conenctedCallback`
|
I adjusted the tests to capture the new findings in whatwg/dom#447. I.e. the tests now ensure that the behavior is the same regardless of whether slots are created in the constructor or @domenic You mind taking another look if this is still appropriate? |
Firefox (nightly)Testing web-platform-tests at revision 211f2b1 All results1 test ran/shadow-dom/slotchange-customelements.html
|
Chrome (unstable)Testing web-platform-tests at revision 211f2b1 All results1 test ran/shadow-dom/slotchange-customelements.html
|
|
@surma sorry for disappearing on this. Is it OK if I turn this over to @hayatoito as the reviewer? I understand he is also looking into other web platform test changes for this spec change. |
|
Absolutely fine by me :) |
|
Sure. I'll take a look. |
|
I'll review this PR after whatwg/dom#459 is merged. |
| <slots-in-callback id="callback-parser"><div></div></slots-in-callback> | ||
| <script> | ||
| test(function () { | ||
| assert_array_equals(calls, ["constructor-parser", "callback-parser", "constructor-upgrade", "callback-upgrade"]); |
There was a problem hiding this comment.
I think this should be:
assert_array_equals(calls, ["constructor-upgrade", "callback-upgrade", "constructor-parser", "callback-parser"]);
That matches the current behavior of Blink.
If we want to avoid to depend on the microtask execution order, it might be better to use different calls-ish variables or something, instead of using one calls variable for all.
There was a problem hiding this comment.
Good call. I will separate this into two tests (as it was a couple of commits before)
|
@hayatoito Took a slightly different path than I thought I would. PTAL :) |
This is pending consensus on whatwg/dom#447
This is my first platform test, so please review and let me know what to improve :)